12. Checking for More Problem Records

Checking for More Problem Records

Question:

Start Quiz:

Solution:

INSTRUCTOR NOTE:

Solutions

If you want to check our solution for the problem, look at the end of this lesson for Quiz Solutions.

Solution

Solution Code

Here is the code Caroline shows in the solution video:

num_problem_students = 0
for enrollment in enrollments:
    student = enrollment['account_key']
    if (student not in unique_engagement_students and 
            enrollment['join_date'] != enrollment['cancel_date']):
        print enrollment
        num_problem_students += 1

num_problem_students